<html>
<head>
    <script src="{:base_url()}Public/js/jquery1.9.1.min.js"></script>
</head>
<body>
    web 存储：
    <input type="text" id="username">

<button id="webstorage">webstorage</button>
<button id="clear_webstorage">clear_webstorage</button>
<script>
    $('#username').val(localStorage.getItem('testusername'));
    $('#webstorage').click(function () {
        localStorage.setItem('testusername',$('#username').val());
    });
    $('#clear_webstorage').click(function () {
        localStorage.clear();
    });
</script>
</body>
</html>